import java.io.Serializable;

public class Student implements Serializable {
    int Stu_id;
    String name;
    int age;
    String gender;

    public  Student(){}

    public Student(int stu_id, String name, int age, String gender) {
        Stu_id = stu_id;
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "Student{" +
                "Stu_id=" + Stu_id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                '}';
    }

    public int getStu_id() {
        return Stu_id;
    }

    public void setStu_id(int stu_id) {
        Stu_id = stu_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if(age<0||age>100){
            throw new RuntimeException();
        }
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
}
